/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.gap.entities;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Yunita
 */
@Entity
@Table(name = "gap_transaction_revision_detail")
@XmlRootElement
//@NamedQueries({
//    @NamedQuery(name = "GapTransactionRevisionDetail.findAll", query = "SELECT g FROM GapTransactionRevisionDetail g"),
//    @NamedQuery(name = "GapTransactionRevisionDetail.findBySync", query = "SELECT g FROM GapTransactionRevisionDetail g WHERE g.sync = :sync"),
//    @NamedQuery(name = "GapTransactionRevisionDetail.findByRevisionDetailId", query = "SELECT g FROM GapTransactionRevisionDetail g WHERE g.revisionDetailId = :revisionDetailId"),
//    @NamedQuery(name = "GapTransactionRevisionDetail.findByRevisionDetailDiscount", query = "SELECT g FROM GapTransactionRevisionDetail g WHERE g.revisionDetailDiscount = :revisionDetailDiscount"),
//    @NamedQuery(name = "GapTransactionRevisionDetail.findByRevisionDetailPrice", query = "SELECT g FROM GapTransactionRevisionDetail g WHERE g.revisionDetailPrice = :revisionDetailPrice"),
//    @NamedQuery(name = "GapTransactionRevisionDetail.findByRevisionDetailNett", query = "SELECT g FROM GapTransactionRevisionDetail g WHERE g.revisionDetailNett = :revisionDetailNett")})
public class GapTransactionRevisionDetail implements Serializable {
    private static final long serialVersionUID = 1L;
    @Column(name = "sync")
    private String sync;
    @Id
    @Basic(optional = false)
    @Column(name = "revision_detail_id")
    private Integer revisionDetailId;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "revision_detail_discount")
    private BigDecimal revisionDetailDiscount;
    @Column(name = "revision_detail_price")
    private BigDecimal revisionDetailPrice;
    @Column(name = "revision_detail_nett")
    private BigDecimal revisionDetailNett;
    @Lob
    @Column(name = "revision_detail_description")
    private String revisionDetailDescription;
    @JoinColumn(name = "revision_detail_revision_id", referencedColumnName = "revision_id")
    @ManyToOne
    private GapTransactionRevision revisionDetailRevisionId;
    @JoinColumn(name = "revision_detail_item_id", referencedColumnName = "item_id")
    @ManyToOne
    private GapMasterItem revisionDetailItemId;

    public GapTransactionRevisionDetail() {
    }

    public GapTransactionRevisionDetail(Integer revisionDetailId) {
        this.revisionDetailId = revisionDetailId;
    }

    public String getSync() {
        return sync;
    }

    public void setSync(String sync) {
        this.sync = sync;
    }

    public Integer getRevisionDetailId() {
        return revisionDetailId;
    }

    public void setRevisionDetailId(Integer revisionDetailId) {
        this.revisionDetailId = revisionDetailId;
    }

    public BigDecimal getRevisionDetailDiscount() {
        return revisionDetailDiscount;
    }

    public void setRevisionDetailDiscount(BigDecimal revisionDetailDiscount) {
        this.revisionDetailDiscount = revisionDetailDiscount;
    }

    public BigDecimal getRevisionDetailPrice() {
        return revisionDetailPrice;
    }

    public void setRevisionDetailPrice(BigDecimal revisionDetailPrice) {
        this.revisionDetailPrice = revisionDetailPrice;
    }

    public BigDecimal getRevisionDetailNett() {
        return revisionDetailNett;
    }

    public void setRevisionDetailNett(BigDecimal revisionDetailNett) {
        this.revisionDetailNett = revisionDetailNett;
    }

    public String getRevisionDetailDescription() {
        return revisionDetailDescription;
    }

    public void setRevisionDetailDescription(String revisionDetailDescription) {
        this.revisionDetailDescription = revisionDetailDescription;
    }

    public GapTransactionRevision getRevisionDetailRevisionId() {
        return revisionDetailRevisionId;
    }

    public void setRevisionDetailRevisionId(GapTransactionRevision revisionDetailRevisionId) {
        this.revisionDetailRevisionId = revisionDetailRevisionId;
    }

    public GapMasterItem getRevisionDetailItemId() {
        return revisionDetailItemId;
    }

    public void setRevisionDetailItemId(GapMasterItem revisionDetailItemId) {
        this.revisionDetailItemId = revisionDetailItemId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (revisionDetailId != null ? revisionDetailId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof GapTransactionRevisionDetail)) {
            return false;
        }
        GapTransactionRevisionDetail other = (GapTransactionRevisionDetail) object;
        if ((this.revisionDetailId == null && other.revisionDetailId != null) || (this.revisionDetailId != null && !this.revisionDetailId.equals(other.revisionDetailId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.gap.entities.GapTransactionRevisionDetail[ revisionDetailId=" + revisionDetailId + " ]";
    }
    
}
